package com.project.service.impl;

import com.project.bean.CutPageBean;
import com.project.bean.GoodsBean;
import com.project.dao.IAssessDao;
import com.project.dao.IGoodsDao;
import com.project.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl implements IGoodsService {
    @Autowired
    private IGoodsDao dao;
    @Autowired
    private IAssessDao assessDao;
    @Override
    public CutPageBean<GoodsBean> findByItem(Integer pageNo, String name) {
        return dao.findByItem(pageNo,name);
    }

    @Override
    public GoodsBean findById(int id) {
        GoodsBean goods = dao.findById(id);
        goods.setAssessList(assessDao.findByProduct(id));
        return goods;
    }
}
